package com.xielx.ohs.web;

import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class DeployController {
        private static final Logger log = LoggerFactory.getLogger(DeployController.class);
        private static final CloseableHttpClient httpClient = HttpClients.createDefault();
        private static final String DOMAIN = "http://192.158.1.31:8080";


        @RequestMapping("/deploy")
        public void proxy(HttpServletRequest request, HttpServletResponse response){
                log.info("recv the deploy url:{}",request.getRequestURI());
                if (HttpMethod.GET.matches(request.getMethod())) {
                        HttpGet get = new HttpGet(DOMAIN);
                }

        }
}
